package trunk.view;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JTextField;

import trunk.control.UsuarioControlador;

@SuppressWarnings("serial")
public class AnexosPanel extends JPanel{
    private JButton anexarButton;
	private JTextField anexo1Campo;

    public AnexosPanel(UsuarioControlador controlador) {
    	setBorder(javax.swing.BorderFactory.createEtchedBorder());
    	
		anexarButton = new JButton("Anexar");
		anexarButton.addActionListener(controlador);
		
		anexo1Campo = new JTextField();
		anexo1Campo.setEditable(false);
        anexo1Campo.setText("Escolha o arquivo a anexar");
        
        javax.swing.GroupLayout AnexosPanelLayout = new javax.swing.GroupLayout(this);
        setLayout(AnexosPanelLayout);
        AnexosPanelLayout.setHorizontalGroup(
            AnexosPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(AnexosPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(anexarButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(anexo1Campo, javax.swing.GroupLayout.DEFAULT_SIZE, 307, Short.MAX_VALUE)
                .addContainerGap())
        );
        AnexosPanelLayout.setVerticalGroup(
            AnexosPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(AnexosPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(AnexosPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(anexarButton)
                    .addComponent(anexo1Campo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
	}
    

    public JTextField getAnexo1Campo() {
		return anexo1Campo;
	}

	public void setAnexo1Campo(String arquivo) {
		this.anexo1Campo.setText(arquivo);
	}

	public JButton getAnexarButton() {
		return anexarButton;
	}
}
